﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChessEst1
{
 
    class ChessPlayer
    {
        
        int playerID;
        public int PlayerID
        {
            get
            {
                return playerID;
            }

            private set
            {
                playerID = value;
            }
        }

        int totalScore;
        public int TotalScore
        {
            get
            {
                return totalScore;
            }

            set
            {
                totalScore = value;
            }
        }

        int rating;
        public int Rating
        {
            get
            {
                return rating;
            }
            private set
            {
                rating = value;
            }

        }

        private int opponentScoreInt;
        public int OpponentScoreInt
        {
            get
            {
                return opponentScoreInt;
            }

            set
            {
                opponentScoreInt = value;
            }
        }   

        private List<int> playerOpponentIDList = new List<int>();
        public List<int> PlayerOpponentIDList //a read only list when public
        {
            get
            {
                return playerOpponentIDList;
            }
            private set
            {
                playerOpponentIDList = value;
            }

        }

        private List<int> wonLossList = new List<int>();
        public List<int> WonLossList //a read only list when public
        {
            get
            {
                return wonLossList;
            }
            private set
            {
                wonLossList = value;
            }

        }


        public void WonLossOpponentIDLog (int WonOrLossint, int OpponentiD)
        {
            wonLossList.Add(WonOrLossint);
            playerOpponentIDList.Add(OpponentiD);            
        }
        public void ZeroOutAllZeroableParametersFunction()
        {
            //zero out all parameters that need to be reset to zero inbetween rounds here
            totalScore = 0;
            opponentScoreInt = 0;
            playerOpponentIDList = new List<int>();
            wonLossList = new List<int>();
        }


        public ChessPlayer() //useful for when instantiating a temp variable and for error control
        {
            playerID = -1; totalScore = -1; 
        } 


        public ChessPlayer(int thePlayerID, int thePlayerRating)
        {
            playerID = thePlayerID;
            rating = thePlayerRating;
        }

    }

    class WinningChessPlayer
    {
        public WinningChessPlayer() { }

        public WinningChessPlayer(int RoundNo, int PlayerEyeD, int TotalScore, int RAting)
        {
            roundN = RoundNo;
            playerID = PlayerEyeD;
            totalScore = TotalScore;
            rating = RAting;
           // StatusInt = aStatusInt;            
        }

        public WinningChessPlayer(ChessPlayer cp)
        {
            playerID = cp.PlayerID;
            totalScore = cp.TotalScore;
            rating = cp.Rating;
            opponentScoreInt = cp.OpponentScoreInt;
        }

        double performanceRatingElo; //the performance rating of the winning player, based on the average opposition
        public double PerformanceRatingElo
        {
            get
            {
                return performanceRatingElo;
            }
            set
            {
                performanceRatingElo = value;
            }
        }

        double oppositionRatingAvg; //the average opposition Elo vs. the winning player
        public double OppositionRatingAvg
        {
            get
            {
                return oppositionRatingAvg;
            }
            set
            {
                oppositionRatingAvg = value;
            }
        }

        int roundN;
        public int RoundN
        {
            get
            {
                return roundN;
            }

            set
            {
                roundN = value;
            }
        }

        int playerID;
        public int PlayerID
        {
            get
            {
                return playerID;
            }

            private set
            {
                playerID = value;
            }
        }

        int totalScore;
        public int TotalScore
        {
            get
            {
                return totalScore;
            }

            set
            {
                totalScore = value;
            }
        }

        int rating;
        public int Rating
        {
            get
            {
                return rating;
            }
            private set
            {
                rating = value;
            }

        }

        private int opponentScoreInt; //opponent score, used to sort
        public int OpponentScoreInt
        {
            get
            {
                return opponentScoreInt;
            }

            set
            {
                opponentScoreInt = value;
            }
        }

        private List<int> playerOpponentIDList = new List<int>();
        public List<int> PlayerOpponentIDList //a read only list when public
        {
            get
            {
                return playerOpponentIDList;
            }
            set
            {
                playerOpponentIDList = value;
            }

        }

        private List<int> wonLossList = new List<int>(); //whether a 1 (win) or 0 (loss) against a particular opponent.  used with list below in tandem.
        public List<int> WonLossList //a read only list when public
        {
            get
            {
                return wonLossList;
            }
            set
            {
                wonLossList = value;
            }

        }


        public void WonLossOpponentIDLog(List<int> playerOpponentIDList_, List<int> WonLossList_)
        {
            playerOpponentIDList = playerOpponentIDList_;
            WonLossList = WonLossList_;
        }

    }
}

